package com.huaxia.day16;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileTestN {

    public static void main(String[] args) {
//        t1();
        t2();
        t3();
    }

    // 绝对路径
    public static void t1() {
        File file1 = new File("d:\\A\\B");
        file1.mkdirs();
    }

    public static void t2() {
        String filePath = "A" + File.separator + "B";
        File file1 = new File("\\A\\B");
        file1.mkdirs();
    }

    public static void t3() {
        try {
            String s = "A65UY";
            byte b[] = s.getBytes();
            // 追加标识
            FileOutputStream file = new FileOutputStream("test.txt", true);
            file.write(b);
            file.close();
        } catch (IOException e) {
            System.out.println(e.toString());
        }
    }
}

